import { IResPwdParams } from '@/main/mainTypes'
import { myRequest } from '@/utils/requestTools'

/**
 *  获取宽基列表
 * @param params 请求参数
 * @param callback 请求完成的回调
 */
export const loadWideBaseListApi = (callback: (suc: boolean, dat?: any) => void) => {
  myRequest({ url: '/fundApi/baseInfo/getBiList', data: {} }, callback)
}

/**
 * 修改密码
 * @param params 修改密码需要的参数
 * @param callback 修改后的回调
 */
export const modifyPassword = (params: IResPwdParams, callback: (suc: boolean) => void) => {
  myRequest({ url: '/authApi/login/changePwd', data: params }, callback)
}

// --------------------------------------------------- requestAll 的使用(基于 axios 的二次封装) ---------------------------------------------------
// export const requestWideList = () => getRequest({ url: '/fundApi/baseInfo/getBiList', data: {} })
// export const requestTimeTag = () => getRequest({ url: '/fundApi/statics/getTag', data: {} })
// useEffect(() => requestAll([requestWideList(), requestTimeTag()], [(_, dat) => console.log(dat), (_, dat) => console.log(dat)]), [])
